
package com.demo.webapp.config;

/**
 * 贯穿整个application的常量对象
 *
 * @author ryuu.kk
 */
public final class Constants {

    private Constants() {
        // hide me
    }
    
    //~ Static fields/initializers =============================================

    /**
     * 当前application的ResourceBundle名称
     */
    public static final String BUNDLE_KEY = "ApplicationResources";

    /**
     * 从系统属性中查找文件分隔符
     * File separator from System properties
     */
    public static final String FILE_SEP = System.getProperty("file.separator");

    /**
     * 从系统属性中查找用户空间
     * User home from System properties
     */
    public static final String USER_HOME = System.getProperty("user.home") + FILE_SEP;

    /**
     * 以HashMap存储整个应用的Key名称
     * 该范围是application
     */
    public static final String CONFIG = "appConfig";

    /**
     * Session scope attribute that holds the locale set by the user. By setting this key
     * to the same one that Struts uses, we get synchronization in Struts w/o having
     * to do extra work or have two session-level variables.
     */
    public static final String PREFERRED_LOCALE_KEY = "org.apache.struts2.action.LOCALE";

//    /**
//     * The request scope attribute under which an editable user form is stored
//     */
//    public static final String USER_KEY = "userForm";
//
//    /**
//     * The request scope attribute that holds the user list
//     */
//    public static final String USER_LIST = "userList";
//
//    /**
//     * The request scope attribute for indicating a newly-registered user
//     */
//    public static final String REGISTERED = "registered";
//
//    /**
//     * The name of the Administrator role, as specified in web.xml
//     */
//    public static final String ADMIN_ROLE = "ROLE_ADMIN";
//
//    /**
//     * The name of the User role, as specified in web.xml
//     */
//    public static final String USER_ROLE = "ROLE_USER";
//
//    /**
//     * The name of the user's role list, a request-scoped attribute
//     * when adding/editing a user.
//     */
//    public static final String USER_ROLES = "userRoles";
//
//    /**
//     * The name of the available roles list, a request-scoped attribute
//     * when adding/editing a user.
//     */
//    public static final String AVAILABLE_ROLES = "availableRoles";

    //~~ 一些配置相关的属性名========================================================
    /**
     * 站点配置语言的Key
     */
    public static final String CONFIG_I18N = "SITE_I18N";
    
    /**
     * 站点配置的email信息
     * 站点可有配置的Email地址向外发送系统邮件
     */
    public static final String CONFIG_EMAIL = "SITE_EMAIL";
    
    /**
     * 功能元数据KEY
     * 一个站点启动,通过该KEY可以查询站点所有角色对应的功能列表
     */
    public static final String CONFIG_FUNCTION_ACL = "FUNCTION_ACL";
    
    /**
     * 站点WEB-CACHE缓存Key
     */
    public static final String CONFIG_WEBCACHE_KEY = "SITE_WEBCACHE";
    
    // ~~ 缓存相关配置 
    /**
     * WEB-CACHE缓存地址的KEY
     */
    public static final String APP_WEBCACHE_URL = "webcache.url";
    
    /**
     * WEB-CACHE缓存开关名
     */
    public static final String APP_WEBCACHE_SWITCH = "webcache.enable";
    
    /**
     * WEB-CACHE缓存模型列表
     * @deprecated 全局不存储web缓存模型
     */
	public static final String APP_WEBCACHE_MODEL_LIST = "webcache.model.list";
	
	// ~~ 站点公共文件夹相关配置 
    /**
     * 公共目录Key
     * 站点的默认公共路径的KEY
     * 如果当前访问的站点Site的resPath未设置公共路径,
     * 则使用该Key从站点配置中查找
     */
    public static final String PUBLISH_FOLDER_KEY = "app.publish.folder";
    
    /**
     * 站点公共目录的名称
     * 该目录保存剪切图片资源
     */
    public static final String PUBLISH_FOLDER_NAME = "publish_folder";
    
    /**
     * 默认公共路径
     * 如果Site不指定资源路径,则使用该默认路径
     */
    public static final String DEFAULT_RESOURCE_PATH = "www_resource";
    
    /**
     * CSS主题名设置(通过该名称查找对应主题).
     */
    public static final String CSS_THEME = "csstheme";
    
    /**
     * 自定义指令名(通过该名称,查找扩展指令的配置文件信息)
     */
    public static final String CUSTOM_DIRECTIVE = "customDirective";
    // ~~============================================================================
    /**
     * Struts Menu的配置名称
     */
    public static final String MENU_CONFIG_NAME = "struts-menu";
    
}
